package inabit.inabitcompiler.productions.values;

import inabit.compiler.parser.grammar.NonTerminal;
import inabit.compiler.parser.grammar.Production;
import inabit.compiler.parser.grammar.Symbol;
import inabit.inabitcompiler.parser.InabitSemanticAction;

/**G -> N*/
/**@author Rafael Rocha*/
public class G_Rule extends Production{
	private NonTerminal N;
	
	public G_Rule() {
		super("G");
	}
	
	public Symbol[] production(final NonTerminal nonTerminal) {
		N = new NonTerminal("N");
		Symbol[] symbols = {
				N,
				new InabitSemanticAction(nonTerminal) {
					
					@Override
					public void execute() throws Exception {
						nonTerminal.code = N.code;
					}
				}
		};
		return symbols;
	}
}
